<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>DoYouHaoBaby示例：静态页面生成</title>
<link rel='stylesheet' type='text/css' href='/doyouhaobaby/DoYouHaoBaby/Demos/Public/css/common.css'>
 </head>
 <body>
 <div class="main">
 <h2>DoYouHaoBaby示例之：静态页面生成</h2>
<div class="title">设置页面生成静态和有效期</div><br/>
<div class="result" style="color:red">当前时间：2011-06-06 20:52:46</div>

<a href="javascript:location.reload()">刷新页面</a> 后注意看时间是否有变化

 <div class="line"></div>
 <div class="title">示例源码</div><br/>
 <div class="li_title">配置文件Config.php</div><br/>
 <div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/**<br /><br />&nbsp;//&nbsp;&nbsp;The&nbsp;DoYouHaoBaby&nbsp;PHP&nbsp;FrameWork&nbsp;-&nbsp;html<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//<br />&nbsp;//&nbsp;&nbsp;“Copyright”<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;(C)&nbsp;2010&nbsp;-&nbsp;2011&nbsp;http://doyouhaobaby.net&nbsp;All&nbsp;rights&nbsp;reserved.<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;This&nbsp;is&nbsp;not&nbsp;a&nbsp;free&nbsp;software,&nbsp;use&nbsp;is&nbsp;subject&nbsp;to&nbsp;license&nbsp;terms<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//<br />&nbsp;//&nbsp;&nbsp;“About&nbsp;This&nbsp;File”<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;html&nbsp;基本配置文件<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br /><br />*/<br /><br /></span><span style="color: #007700">!</span><span style="color: #0000BB">defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'DYHB_PATH'</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;exit;<br /><br /></span><span style="color: #0000BB">$arrConfigs&nbsp;</span><span style="color: #007700">=&nbsp;array(<br /><br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'HTML_CACHE_ON'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">true</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'HTML_CACHE_TIME'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">10</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//'HTML_READ_TYPE'=&gt;1,<br /></span><span style="color: #007700">);<br /><br />return&nbsp;</span><span style="color: #0000BB">array_merge</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$arrConfigs</span><span style="color: #007700">,require&nbsp;</span><span style="color: #DD0000">'../Config.php'&nbsp;</span><span style="color: #007700">);<br /></span>
</span>
</code></div>
 <div class="li_title">静态定义文件html.php</div><br/>
 <div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/**<br /><br />&nbsp;//&nbsp;&nbsp;The&nbsp;DoYouHaoBaby&nbsp;PHP&nbsp;FrameWork&nbsp;-&nbsp;html<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//<br />&nbsp;//&nbsp;&nbsp;“Copyright”<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;(C)&nbsp;2010&nbsp;-&nbsp;2011&nbsp;http://doyouhaobaby.net&nbsp;All&nbsp;rights&nbsp;reserved.<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;This&nbsp;is&nbsp;not&nbsp;a&nbsp;free&nbsp;software,&nbsp;use&nbsp;is&nbsp;subject&nbsp;to&nbsp;license&nbsp;terms<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//<br />&nbsp;//&nbsp;&nbsp;“About&nbsp;This&nbsp;File”<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;html&nbsp;静态配置文件<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br /><br />*/<br /><br /></span><span style="color: #007700">!</span><span style="color: #0000BB">defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'DYHB_PATH'</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;exit;<br /><br />return&nbsp;array(<br /><br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'*'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'{$_SERVER.REQUEST_URI|md5}'</span><span style="color: #007700">),<br />);<br /></span>
</span>
</code></div>
 <div class="li_title">控制器IndexControl类</div><br/>
 <div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/**<br /><br />&nbsp;//&nbsp;&nbsp;The&nbsp;DoYouHaoBaby&nbsp;PHP&nbsp;FrameWork&nbsp;-&nbsp;html<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//<br />&nbsp;//&nbsp;&nbsp;“Copyright”<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;(C)&nbsp;2010&nbsp;-&nbsp;2011&nbsp;http://doyouhaobaby.net&nbsp;All&nbsp;rights&nbsp;reserved.<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;This&nbsp;is&nbsp;not&nbsp;a&nbsp;free&nbsp;software,&nbsp;use&nbsp;is&nbsp;subject&nbsp;to&nbsp;license&nbsp;terms<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//<br />&nbsp;//&nbsp;&nbsp;“About&nbsp;This&nbsp;File”<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;html&nbsp;Index控制器<br />&nbsp;//&nbsp;&nbsp;+---------------------------------------------------------------------<br /><br />*/<br /><br /></span><span style="color: #007700">!</span><span style="color: #0000BB">defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'DYHB_PATH'</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;exit;<br /><br />class&nbsp;</span><span style="color: #0000BB">IndexController&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Controller</span><span style="color: #007700">{<br /><br />}<br /></span>
</span>
</code></div>
</div>
 </body>
</html>
